﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace Chemix.Util
{
    public class PerformanceTester : MonoBehaviour
    {

        // Use this for initialization
        void Start()
        {
            float sqrtNumber = Mathf.Sqrt(numberOfObjects);
            int ceil = (int)Mathf.Ceil(sqrtNumber);

            for (int i = 0; i < numberOfObjects; i++)
            {
                var go = Instantiate(objectPrefab);
                var position = new Vector3(-i / ceil * positionScalar, 0, -i % ceil * positionScalar);
                go.transform.position = position;
            }
        }


        [SerializeField]
        private int numberOfObjects = 9;
        [SerializeField]
        private float positionScalar = 0.08f;
        [SerializeField]
        private GameObject objectPrefab;
    }
}